home *** CD-ROM | disk | FTP | other *** search
/ C/C++ Users Group Library 1996 July / C-C++ Users Group Library July 1996.iso / vol_400 / 422_02 / dosutil / off.c < prev    next >
C/C++ Source or Header  |  1994-03-20  |  15KB  |  408 lines

  1. /*
  2.  * Screen-saver that moves a "happy face" around the screen, with
  3.  * a few effects thrown in at regular intervals.
  4.  *
  5.  * Copyright 1991-1994 Dave Dunfield
  6.  * All rights reserved.
  7.  *
  8.  * Permission granted for personal (non-commercial) use only.
  9.  *
  10.  * Compile command: cc off -fop
  11.  */
  12. #include <stdio.h>
  13. #include <window.h>
  14.  
  15. #define    UP        0x1E        /* Trail moving up */
  16. #define    DOWN    0x1F        /* Trail moving down */
  17. #define    RIGHT    0x10        /* Trail moving right */
  18. #define    LEFT    0x11        /* Trail moving left */
  19. #define    STOP    0x02        /* Normal stopped Smiley */
  20. #define    HURT    0x01        /* Smiley taking a beating */
  21. #define    EXPLODE    0x07        /* Expoding markers */
  22.  
  23. int x = 0, y = 0, x1 = 75, y1 = 24, fillcnt = 0;
  24. char fill = 0;
  25.  
  26. /* Various trail filler characters */
  27. char filltab[] = { 0, 0x04, 0, 0x09, 0, '*', 0, 0xFE, 0, 0xF9 };
  28.  
  29. /* Copyright messages shown at opening */
  30. char *yptr = "Smiley Screen Saver";
  31. char *xptr = "Copyright 1991-1994 Dave Dunfield - All rights reserved.";
  32.  
  33. /* Special effects characters output in same spot */
  34. char rotate1[] = { '-', '\\', '|', '/', 0 };
  35. char rotate2[] = { '-', '/', '|', '\\', 0 };
  36. char fade[] = { 0x20, 0xB0, 0xB1, 0xB2, 0xDB, 0xB2, 0xB1, 0xB0, 0 };
  37. char skip[] = { 0xC4, 0xC2, 0xD2, 0xC2, 0xC4, 0xC1, 0xD0, 0xC1, 0xC4, 0 };
  38. char line[] = { 0xF0, 0x3D, 0x2D, 0x20, 0x2D, 0x3D, 0 };
  39. char grow[] = { 0xFE, 0x04, 0x07, 0xF9, 0xFA, 0x20, 0xFA, 0xF9, 0x07, 0x04,
  40.     0xFE, 0x02, 0x02, 0 };
  41.  
  42. /* "Fortune Cookie" messages */
  43. static char *msgs[] = {
  44. "Smiley Screen Saver",
  45. "Copyright 1991-1994 Dave Dunfield - All rights reserved.",
  46. "He who has imagination without learning has wings but no feet",
  47. "Everyone needs to believe in something; I believe I'll have another beer",
  48. "God helps those who help themselves.",
  49. "Every absurdity has a champion to defend it",
  50. "Flee at once, all is discovered",
  51. "Everyone is enthuastic about your work",
  52. "Do not underestimate the power of FORCE",
  53. "Don't tell me what you dreamt last nite for I've been reading Freud",
  54. "Death: To suddenly stop sinning",
  55. "Do not merely believe in miracles; rely on them",
  56. "retupmoc eht edisni deppart ma I - PLEH",
  57. "A stitch in time saves nine",
  58. "Shift to the left, Shift to the right, POP up PUSH down, BYTE BYTE BYTE!!!",
  59. "On a clear disk you can seek forever...",
  60. "Beam me up Scottie.... There in no intelligent life down here!",
  61. "Don't be humble... You're not that great",
  62. "Be security conscious -- National defence is at stake!",
  63. "A good memory does not equal pale ink",
  64. "Age and treachery will always overcome youth and skill",
  65. "Your buisness will go though a period of considerable expansion",
  66. "A king's castle is his home",
  67. "A hermit is a deserter from the army of humanity",
  68. "You will be hungry within the hour",
  69. "Volcano: A mountain with hiccups",
  70. "You don't know what I know",
  71. "Too men looking though the same bars; one sees mud, the other one stars",
  72. "Time is nature's way of preventing everything from happening at once",
  73. "Within a computer, natural language in unnatural",
  74. "Those of you who think you know everything are annoying those of us who do!",
  75. "You always have a chance for winning - The others might lose",
  76. "There is no time like the pleasant",
  77. "Use GOTO's only to implement a fundamental structure",
  78. "The plural of spouse is spice",
  79. "Toto, I have a feeling we're not in Kansas any more!",
  80. "The future isn't what it used to be",
  81. "Those who in quarrels interpose must often wipe a bloody nose",
  82. "Sturgeon's Law: Ninety percent of everything is crud",
  83. "The end justifys the means",
  84. "The important thing is not to stop questioning",
  85. "Save yourself!!! - Reboot in 5 seconds",
  86. "Someone is unenthusiastic about your work",
  87. "Passwords are implemented as a result of insecurity",
  88. "Never insult an alligator until you have crossed the river",
  89. "Like winter snow on summer lawn, time past is time gone",
  90. "It's a poor workman who blames his tools",
  91. "Liar: one who tells an unpleasant truth",
  92. "It's easier to write a bad program than to understand a good one",
  93. "It's easier to write a good program than to understand a bad one",
  94. "It is a poor judge who cannot award a prize",
  95. "If you want a fortune, go to a chinese restaurant",
  96. "Modesty is a vastly overrated virtue",
  97. "Mistakes are oft the stepping stones to failure",
  98. "Many are cold, but few are frozen",
  99. "It is a wise bird who builds his nest in a tree",
  100. "Logic is like a little bird, sitting in a tree, that smells AWFUL",
  101. "Ignorance is when you don't know anything, and someone finds out",
  102. "If at first you don't succeed, try again, then quit - no sense being a fool",
  103. "Hell is empty and all the devils are here",
  104. "Is there a pilot on board?",
  105. "She walks as if balancing the family tree on her nose",
  106. "God does not play dice",
  107. "Every purchase has its price",
  108. "He who speak with forked tongue, not need chopsticks",
  109. "A plucked goose won't lay golden eggs",
  110. "There is no heavier burden than a great potential",
  111. "Satire does not look pretty upon a tombstone",
  112. "Some programming languages manage to absorb change, but withstand progress",
  113. "Paranoia doesn't mean the whole world really isn't out to get you",
  114. "No civilized person ever goes to bed the same day he gets up",
  115. "Marriage: A three ring circus - Engagement ring, Wedding ring, Suffering",
  116. "Make sure your comments and code agree",
  117. "It's better to burn out that to rust out",
  118. "Laugh, and the world ignores you. Crying doesn't help either",
  119. "It's better to burn out than to fade away",
  120. "God is not dead; He's only swapped out",
  121. "General notions are generally wrong",
  122. "Good intentions are far more difficult to deal with than malicious behavior",
  123. "Facts do not cease to exist because they are ignored",
  124. "Don't look now, but the man in the moon is laughing at you",
  125. "Anything worth doing is worth asking someone else to do",
  126. "A truly wise man never plays leapfrog with a Unicorn",
  127. "A bird in the bush can't make a mess in your hand",
  128. "To iterate is human, to recurse, divine",
  129. "Those who can, do. Those who can't, simulate",
  130. "Some men are discovered, others are found out",
  131. "Only those who attempt the absurd achieve the impossible",
  132. "Mind your own business Spock, I'm sick of your half-breed interference",
  133. "Of all forms of caution, caution in love is the most fatal",
  134. "Live a clean happy life, and you will soon die of boredom",
  135. "It's easier to fight for one's principles than to live up to them",
  136. "Every creature has within itself a weird uncontrollable urge to punt",
  137. "Don't force it, use a bigger hammer",
  138. "There is so much to say, but your eyes keep interrupting me",
  139. "He who makes no mistakes usually makes nothing",
  140. "Tact is the art of making a point without making an enemy",
  141. "There are more old drunkards than old doctors",
  142. "Last guys don't finish nice",
  143. "I must have slipped a disk, my pack hurts",
  144. "If it doesn't feel good, don't do it",
  145. "God must love the common man, he made so many of them",
  146. "I am not arguing with you -- Im telling you",
  147. "Today is the first day of the rest of your life",
  148. "Today is the last day of your life so far",
  149. "Now and then an innocent man is sent to the legislature",
  150. "Let not the sands of time get in your lunch",
  151. "Never settle with words what you can accomplish with a flame thrower",
  152. "Many pages make a thick book",
  153. "Its a good thing we don't get all the government we pay for",
  154. "Every silver lining has a cloud inside it",
  155. "Due to lack of interest, today has been canceled",
  156. "Even the smallest candle burnes brighter in the dark",
  157. "If you keep burning the candle at both ends, you will soon run out of wax",
  158. "Don't take life too seriously, you will never get out of it alive",
  159. "LISP: To call a spade a thpade.",
  160. "Life as we know it dosn't exist",
  161. "Haste make waste - So do printers",
  162. "Drawing on my fine command of language, I said nothing",
  163. "Better to light one candle than to curse the darkness",
  164. "Avoid temporary variables",
  165. "A hen is only an egg's way of making another egg",
  166. "Lack of leadership is no substitute for inaction",
  167. "A journey of a thousand miles begins with a cash advance",
  168. "To laugh at men of sense is the privilege of fools",
  169. "The best prophet of the future is the p